<template>
    <LDrawerForm
        :visible="visible"  
        :confirmLoading="confirmLoading" 
        :title="title" ref="logForm" 
        :formAttributes="formAttributes"
        :isShowBootomButton="false"
         @handleOk="handleOk" 
         @handleCancel="handleCancel"
         @changeEventHandler="changeEventHandler">
    </LDrawerForm>

</template>

<script>
import LDrawerForm from '@/components/lt/form/LDrawerForm'
import pick from 'lodash.pick'
import request from '@/utils/request'

export default {
    name:'logForm',
    components:{
        LDrawerForm
    },
    data(){
        return{
            title:'详情',
            visible:false,
            confirmLoading: false,
            model:{},
            formAttributes:{
              type:'',//collapse,tabs
              formItems:[
                {
                  title:'标签一',
                  columns:1,
                  fields:[
                    {field:'systemNo',label:'系统编号',component:'input',disabled:true},
                    {field:'operDes',label:'操作描述',component:'textarea',disabled:true},
                    {field:'operRequParam',label:'请求参数',component:'textarea',disabled:true,rows:'8'},
                    {field:'operRespParam',label:'返回参数',component:'textarea',disabled:true,rows:'8'},
                    {field:'operMethod',label:'操作方法',component:'input',disabled:true},
                    {field:'operUrl',label:'请求URL',component:'input',disabled:true},
                    {field:'operIp',label:'请求IP',component:'input',disabled:true},
                    {field:'operTime',label:'操作时间',component:'time',disabled:true},
                    {field:'operEmpNo',label:'操作人工号',component:'input',disabled:true},
                    {field:'operAccountNo',label:'操作人账号',component:'input',disabled:true},
                    {field:'operEmpName',label:'操作人姓名',component:'input',disabled:true},
                  ]
                },
              ]

            }


        }
    },
    methods:{
       
        edit (record) {
            this.visible = true;
            this.model = Object.assign({}, record);
            this.$nextTick(() => {
                this.$refs.logForm.getForm().setFieldsValue(pick(this.model,'systemNo','operDes','operRequParam','operRespParam','operMethod','operUrl','operIp','operTime','operEmpNo','operAccountNo','operEmpName'))
            })
        },
        handleOk(){
            
        },
        handleCancel(){
            this.visible=false
        },
        close () {
            this.$emit('close');
            this.visible = false;
        },
        /**
         * 表单内容发生变化
         */
        changeEventHandler(changeItem){
            console.log(changeItem)
           
        }
    },
    created(){
        
    },
}
</script>